home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Compute! Gazette 1994 July
/
1994-07b.d64
/
15 solitaire
(
.txt
)
next >
Wrap
Commodore BASIC
|
2022-09-20
|
4KB
|
119 lines
10 rem copyright 1994 - compute publications intl ltd - all rights reserved
20 poke53265,peek(53265)and239:poke53296,1
30 dimcd(51),mx(3,3),my(3,3):r$="a234567890jqk":s$="[216][193][211][218]":cl$="[155][150]"
40 z$="[157][157][157][157][157][157][194][194]":f$="[146][145][157][213][192][192][192][192][201]"+z$+z$+z$+z$+"[157][157][157][157][157][157][202][192][192][192][192][203]"
50 z$="[157][157][157][157][157][157] ":c$="[146][145][157] "+z$+z$+z$+z$+"[157][157][157][157][157][157] "
60 bl$="[146] [157][157][157][157] [157][157][157][157] [157][157][157][157] "
70 deffnrn(x)=x-(int(x/13)*13)+1:deffnsu(x)=int(x/13)+1
80 poke53280,0:poke53281,0:gosub960:fori=0to51:cd(i)=i:next
90 fori=0to51:j=52*rnd(0):x=cd(j):cd(j)=cd(i):cd(i)=x:next
100 pt=0:fori=0to3:forj=0to3:mx(i,j)=cd(pt):pt=pt+1:next:next
110 print"[147]"tab(30)"[159][213][192]total[192][201]"
120 fori=1to5:printtab(30)"[194][194]":next:printtab(30)"[202][192][192][192][192][192][192][192][203]"
130 print""tab(30)"[156][213][192]cards[192][201]"
140 fori=1to5:printtab(30)"[194][194]":next:printtab(30)"[202][192][192][192][192][192][192][192][203]"
150 print""tab(25)"[154] [157][157][157][157] re [157][157][157][157]deal[157][157][157][157] "
160 poke214,18:print:printtab(25)"[153] [157][157][157][157]clr [157][157][157][157] all[157][157][157][157] "
170 poke53296,0:poke53265,peek(53265)or16
180 foryy=0to3:forxx=0to3:cd=mx(xx,yy):gosub830:poke54296,15:gosub900
190 poke54296,0:my(xx,yy)=-1:next:next
200 dc=0:xx=0:yy=0:poke53269,1
210 gosub910
220 ff=0:cc=0:t=0
230 poke53248,xx*48+42:poke53249,yy*48+67
240 poke53287,(peek(53287)+8)and15
250 geta$:a=notpeek(56320)and31:ifa=0anda$=""then240
260 ifa$=chr$(13)ora=16then360
270 ifa$="[145]"ora=1thenyy=yy-1:ifyy=-1thenyy=3
280 ifa$=""ora=2thenyy=yy+1:ifyy=4thenyy=0
290 ifa$="[157]"ora=4thenxx=xx-1
300 ifa$=""ora=8thenxx=xx+1
310 if(yy=0oryy=3)andxx>4thenxx=0:goto230
320 ifxx<0andyy<>0andyy<>3thenxx=3
330 ifxx>3andyy<>0andyy<>3thenxx=0
340 ifxx<0thenxx=4
350 goto230
360 ifxx=4then740
370 ifmx(xx,yy)=99then240
380 s=fnsu(mx(xx,yy)):r=fnrn(mx(xx,yy))
390 ifr>9 andcc<>0 andff=0then240
400 ifr<9 andcc<>0 andff=1then240
410 ifr>9thenff=1
420 ifs<>csandcc<>0then240
430 cs=s:my(xx,yy)=-my(xx,yy):t=t+r*my(xx,yy)
440 cc=cc-1:cd$=c$:ifmy(xx,yy)+1thencd$=f$:cc=cc+2
450 ifcc=0thenff=0
460 poke646,7*rnd(0)+3:gosub900
470 poke54273,75:poke54296,15:poke54277,17:poke54278,245:poke54276,17
480 fori=1to50:next:gosub900:poke54276,0:poke54296,0
490 ifffthen520
500 gosub910:ift=15then530
510 goto240
520 ifcc<>4then240
530 px=xx:py=yy:foryy=0to3:forxx=0to3:ifmy(xx,yy)=-1then570
540 poke54277,0:poke54278,255:poke54296,6:poke54276,129
550 fori=0to50step2:poke54273,i:next:poke54273,0:poke54276,0:poke54296,0
560 cd$=c$:gosub900:cd$=bl$:gosub900
570 next:next
580 foryy=0to3:forxx=0to3:ifmy(xx,yy)=-1then630
590 z=99:ifpt<52thenz=cd(pt):pt=pt+1
600 my(xx,yy)=-1:mx(xx,yy)=z:dc=dc+1 :ifz=99then630
610 cd=z:gosub830:poke54296,15:gosub900:poke54296,0:gosub930
620 fori=0to200:next
630 next:next
640 ifdc<52thenxx=px:yy=py:t=0:goto210
650 poke53269,0:a$="you did it!":fork=1to3:fori=21to0step-1:poke214,i:print
660 poke646,8*rnd(1)+1:printtab(6)a$
670 forj=1to50:next:printtab(6)"[145] ":next
680 x=21:ifk=3thenx=10
690 fori=0tox:poke214,i:print:poke646,8*rnd(1)+1:printtab(6)a$
700 forj=1to50:next:printtab(6)"[145] ":next:next
710 poke646,15*rnd(0)+1:printtab(6)a$"[145]"
720 getaa$:ifaa$=""and(peek(56320)and16)=16then710
730 poke53269,1:goto90
740 ifyythen810
750 print""tab(30)"are you[157][157][157][157][157][157][157]sure? ";:poke204,0
760 fori=1to500:next:poke198,0
770 a=notpeek(56320)and31:geta$:ifa$=""anda=0then770
780 poke204,1:print""tab(30)" [157][157][157][157][157][157][157] ";
790 ifa$<>chr$(13)anda<>16then230
800 print"[147]":goto90
810 px=xx:py=yy:cd$=c$:foryy=0to3:forxx=0to3:my(xx,yy)=-1:gosub900:next:next
820 t=0:xx=px:yy=py:goto210
830 fl=0:iffnrn(cd)=10thenfl=1
840 cd$=""+mid$(cl$,fnsu(cd),1)
850 iffltheny$="10":goto870
860 y$=mid$(r$,fnrn(cd),1)+" "
870 x$=mid$(s$,fnsu(cd),1):cd$=cd$+y$+" "+x$+"[157][157][157][157] [157][157][157][157] [157][157][157][157]"+x$+" "
880 ifflthencd$=cd$+y$:return
890 cd$=cd$+" "+left$(y$,1):return
900 poke214,yy*6:print:printtab(xx*6+1)""cd$:return
910 poke214,4:print:printtab(31)"";
920 printa$(int(t/10))"[145][145][145][145][145]"a$(t-int(t/10)*10)
930 poke214,13:print:printtab(31)"[158]";
940 z=52-pt:printa$(int(z/10))"[145][145][145][145][145]"a$(z-int(z/10)*10)
950 return
960 fori=0to9:readx$:forj=1to14step3:fork=0to2
970 ifmid$(x$,j+k,1)=" "thena$(i)=a$(i)+"[146] "
980 ifmid$(x$,j+k,1)="."thena$(i)=a$(i)+" "
990 next:a$(i)=a$(i)+"[157][157][157]":next:next
1000 data".... .. .. ...."
1010 data" . .. . . ..."
1020 data"... ..... ..."
1030 data"... . .. ...."
1040 data" .. .... . ."
1050 data".... ... ...."
1060 data".... .... ...."
1070 data"... . . . . "
1080 data".... ..... ...."
1090 data".... .... . ."
1100 fori=0to63:readj:poke896+i,j:next
1110 poke53264,0:poke53269,0:poke53275,0:poke53287,3:poke2040,14:return
1120 data192,24,0,224,56,0,112,112
1130 data0,56,224,0,29,192,0,15
1140 data128,0,7,0,0,15,128,0
1150 data29,192,0,56,224,0,112,112
1160 data0,224,56,0,192,24,0,0
1170 data0,0,0,0,0,0,0,0,0,0,0,0
1180 data0,0,0,0,0,0,0,0,0,0,0,0